#include <cstdio>
#include <cstring>

const int maxn = 110;

void reverse(char s[]) {
	int len = strlen(s);
	for (int i = 0; i < len/2; i++) {
		int temp = s[i];
		s[i] = s[len-1-i];
		s[len-1-i] = temp;
	}
}

int main() {
	char A[maxn], B[maxn], ans[maxn] = {0};
	scanf("%s %s", A, B);
	reverse(A);
	reverse(B);
	int len1 = strlen(A);
	int len2 = strlen(B);
	int len = len1 > len2 ? len1 : len2;

	for (int i = 0; i < len; i++) {
		int numA = i < len1 ? A[i]-'0' : 0;
		int numB = i < len2 ? B[i]-'0' : 0;
		if (i % 2 == 0) {
			int temp = (numA+numB) % 13;
			if (temp == 10) ans[i] = 'J';
			else if (temp == 11) ans[i] = 'Q';
			else if (temp == 12) ans[i] = 'K';
			else ans[i] = temp+'0';
		} else {
			int temp = numB - numA;
			if (temp < 0) temp += 10;
			ans[i] = temp+'0';
		}
	}

	reverse(ans);
	printf("%s\n", ans);

	return 0;
}
